package ru.jexp.mvc;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class StringCollector {
	public static void init(Object object) {
		Field[] fields = object.getClass().getFields();
		for (int i = 0; i < fields.length; i++) {
			Field field = fields[i];
			if (field.getType().equals(String.class)
					&& (field.getModifiers() | Modifier.STATIC) != 0)
				try {
					field.set(object, field.getName());
				} catch (IllegalArgumentException e) {
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					e.printStackTrace();
				}
		}
	}
}
